<?php if(!defined('BASEPATH')) exit('');

class MY_Controller extends CI_Controller{
	var $data;
	
	function __construct()
	{
		parent::__construct();
		
		$this->output->set_header('Content-Type:text/html; charset=UTF-8');
		date_default_timezone_set('Asia/Seoul');
		
		$this->data->head = new stdClass;
		$this->data->head->title = 'DBDBDIB';
		
		$this->data->head->include = new stdClass;
		$this->data->head->include->css = array('mobiscroll-1.5.2', 'common');
		$this->data->head->include->js = array('mobiscroll-1.5.2', 'common', 'create_poll', 'create_location', 'search', 'poll_main', 'search_result', 'admin_poll');
	}
	
	function _add_css()
	{
		$data = func_get_args();
		foreach($data as $i)
		{
			if(is_array($i))
				$this->data->head->include->css = array_merge($this->data->head->include->css, $i); 
			else 
				$this->data->head->include->css[] = $i;
		}		
	}
	
	function _add_js()
	{
		$data = func_get_args();
		foreach($data as $i)
		{
			if(is_array($i))
				$this->data->head->include->js = array_merge($this->data->head->include->js, $i); 
			else 
				$this->data->head->include->js[] = $i;
		}			
	}
	
	function _unshift_js(){
		$data = func_get_args();
		if(is_array($data))
			$this->data->head->include->js = array_merge($data, $this->data->head->include->js); 
		else
			array_unshift($this->data->head->include->js, $data);
	}
}
